{% extends 'base.html' %}
{% load static %}
{% block title %} 项目记录列表{% endblock %}
{% block search_form %}
    <div class="search-form d-none d-lg-inline-block">
        <form method="get" action="{% url 'ex:schedule_list' project_id %} ">
            <div class="input-group">
                <button type="submit" id="search-btn11" class="btn btn-flat">
                    <i class="mdi mdi-magnify"></i>
                </button>
                <input type="text" id="search-input11" class="form-control" placeholder="请输入关键字"
                       autofocus autocomplete="off" name="keyword"/>
            </div>
        </form>
        <div id="search-results-container">
            <ul id="search-results"></ul>
        </div>
    </div>

{% endblock %}
{% block left-sidebar %}
    <li class="has-sub {% if request.path|slice:':10' == '/plans/ex_' %}active  {% endif %} expand">
                            <a class="sidenav-item-link" href="javascript:void(0)" data-toggle="collapse"
                               data-target="#dashboard"
                               aria-expanded="false" aria-controls="dashboard">
                                <i class="mdi mdi-dribbble"></i>
                                <span class="nav-text">返回上一级</span> <b class="caret"></b>
                            </a>
                            <ul class="collapse {% if request.path|slice:':14' == '/plans/ex_list' %} show {% endif %}" id="dashboard" data-parent="#sidebar-menu">
                                <div class="sub-menu">

                                    <li {% if request.path|slice:':14' == '/plans/ex_list' %}
                                        class="active" {% endif %}>
                                        <a class="sidenav-item-link" href="{% url 'plans:ex_list' %}">
                                            <span class="nav-text">项目列表</span>
                                        </a>
                                    </li>

                                </div>
                            </ul>
                        </li>
    <li class="has-sub {% if request.path|slice:':9' == '/plans/st' %}active  {% endif %} expand">
                            <a class="sidenav-item-link" href="javascript:void(0)" data-toggle="collapse"
                               data-target="#dashboard1"
                               aria-expanded="false" aria-controls="dashboard">
                                <i class="mdi mdi-docker"></i>
                                <span class="nav-text">前期准备</span> <b class="caret"></b>
                            </a>
                            <ul class="collapse {% if request.path|slice:':9' == '/plans/st' %}show  {% endif %}" id="dashboard1" data-parent="#sidebar-menu">
                                <div class="sub-menu">

                                    <li {% if request.path|slice:':19' == '/plans/start_detail' %}
                                        class="active" {% endif %}>
                                        <a class="sidenav-item-link" href="{% url 'plans:start_detail' project_id %}">
                                            <span class="nav-text">通知及方案</span>
                                        </a>
                                    </li>

                                </div>
                            </ul>
                        </li>
    <li class="has-sub {% if request.path|slice:':6' == '/ex/sc' or request.path|slice:':6' == '/ex/pr' %}active  {% endif %} expand">
                            <a class="sidenav-item-link" href="javascript:void(0)" data-toggle="collapse"
                               data-target="#dashboard2"
                               aria-expanded="false" aria-controls="dashboard">
                                <i class="mdi mdi-pinwheel-outline"></i>
                                <span class="nav-text">实施阶段</span> <b class="caret"></b>
                            </a>
                            <ul class="collapse {% if request.path|slice:':6' == '/ex/sc' or request.path|slice:':6' == '/ex/pr' %}show  {% endif %}" id="dashboard2" data-parent="#sidebar-menu">
                                <div class="sub-menu">

                                    <li {% if request.path|slice:':17' == '/ex/schedule_list' %}
                                        class="active" {% endif %}>
                                        <a class="sidenav-item-link" href="{% url 'ex:schedule_list' project_id %}">
                                            <span class="nav-text">项目记录</span>
                                        </a>
                                    </li>
                                    <li {% if request.path|slice:':16' == '/ex/problem_list' %}
                                        class="active" {% endif %}>
                                        <a class="sidenav-item-link" href="{% url 'ex:problem_list' project_id %}">
                                            <span class="nav-text">问题列表</span>
                                        </a>
                                    </li>

                                </div>
                            </ul>
                        </li>
    <li class="has-sub {% if request.path|slice:':6' == '/ex/re'  %}active  {% endif %} expand">
                            <a class="sidenav-item-link" href="javascript:void(0)" data-toggle="collapse"
                               data-target="#dashboard3"
                               aria-expanded="false" aria-controls="dashboard">
                                <i class="mdi mdi-barley"></i>
                                <span class="nav-text">报告阶段</span> <b class="caret"></b>
                            </a>
                            <ul class="collapse{% if request.path|slice:':6' == '/ex/re'  %} show  {% endif %}" id="dashboard3" data-parent="#sidebar-menu">
                                <div class="sub-menu">

                                    <li {% if request.path|slice:':17' == '/ex/report_detail' %}
                                        class="active" {% endif %}>
                                        <a class="sidenav-item-link" href="{% url 'ex:report_detail' project_id %}">
                                            <span class="nav-text">征求意见及报告</span>
                                        </a>
                                    </li>


                                </div>
                            </ul>
                        </li>

{% endblock %}

{% block content-wrapper %}
    <div class="content-wrapper">
        <div class="content">
            <div class="breadcrumb-wrapper">
                <h1>{{ title.project_name }}{% if title.project_exaudit == True %}--外审：{{ title.project_exauditname }}{% endif %}</h1>

                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb p-0">
                        <li class="breadcrumb-item">
                            <a href="{% url 'plans:ex_list' %}">
                                <span class="mdi mdi-home"></span>
                            </a>
                        </li>

                    </ol>
                </nav>

            </div>
            <div class="row">
                <div class="col-lg-6">
                    <div class="card card-default">
                        <div class="card-header card-header-border-bottom">
                            <h2>项目记录</h2>
                        </div>
                        <div class="card-body">
{#                            <p hidden class="mb-5">Using the card component, you can extend the default collapse behavior to#}
{#                                create an accordion. Read bootstrap documentaion for <a#}
{#                                        href="https://getbootstrap.com/docs/4.4/components/collapse/#accordion-example"#}
{#                                        target="_blank">#}
{#                                    more details.</a></p>#}
                            <div id="accordion" class="accordion">
                                <p class="mb-5" > {{ request.user.first_name }} </p>
                                {% for user in user_list %}
                                <div class="card schedule_list">

                                    <div class="card-header" id="heading{{ user.id }}">
                                        <button {% if user.schedule_feedback %} class="btn btn-link mdi mdi-drupal" {% else %} class="btn btn-link" {% endif %} data-toggle="collapse" data-target="#collapse{{ user.id }}"
                                                aria-expanded="false" aria-controls="collapseOne">
                                          {% if user.schedule_feedback %}|{% endif %} {{ user.schedule_title }}   |  {{ user.start_time|date:'Y/m/d' }}{% if user.start_time != user.end_time %}-{{ user.end_time|date:'Y/m/d' }}{% endif %}
                                        </button>
                                    </div>

                                    <div id="collapse{{ user.id }}" class="collapse" aria-labelledby="heading{{ user.id }}"
                                         data-parent="#accordion">

                                        <div class="card-body">
                                            <p class="text-info">被审计单位</p>
                                            {{ user.audit_company.audit_company }} {% if user.audit_company.audit_person %} | {{ user.audit_company.audit_person }}{% endif %}
                                            <p class="text-info">记录内容</p>
                                            {{ user.schedule_content }}
                                            <p class="text-info">记录反馈</p>
                                            {{ user.schedule_feedback }}
                                            <p class="text-info">记录开始时间</p>
                                            {{ user.start_time|date:"Y-m-d" }}
                                            <p class="text-info">记录结束时间</p>
                                            {{ user.end_time|date:"Y-m-d" }}
                                            {% if switch == 'open' %}
                                            <p class="text-warning"><a href="{% url 'ex:schedule_detail' user.id %}" class="justify-content-md-center">修改</a></p>
                                            {% endif %}
                                        </div>
                                        {% if switch == 'open' %}
                                        <button type="submit" class="mb-1 btn btn-square btn-sm btn-outline-secondary justify-content-center schedule_del"
                                                    id="schedule_del" schedule_id="{{ user.id }}">删除
                                            </button>
                                        {% endif %}
                                    </div>
                                </div>
                                {% endfor %}
                                <hr class="w-100">
                                <p class="mb-5" > 其他项目组成员</p>
                                {% for member in member_list %}
                                <div class="card ">
                                    <div class="card-header" id="heading{{ member.id }}">
                                        <button {% if member.schedule_feedback %}class="btn btn-link collapsed mdi mdi-drupal" {% else %}class="btn btn-link collapsed" {% endif %} data-toggle="collapse"
                                                data-target="#collapse{{ member.id }}" aria-expanded="false"
                                                aria-controls="collapse{{ member.id }}">
                                            {% if member.schedule_feedback %}| {% endif %}{{ member.schedule_title }}   |  {{ member.start_time|date:'Y/m/d' }}{% if member.start_time != member.end_time%}-{{ member.end_time|date:'Y/m/d' }}{% endif %}
                                        </button>
                                    </div>
                                    <div id="collapse{{ member.id }}" class="collapse" aria-labelledby="heading{{ member.id }}"
                                         data-parent="#accordion">
                                        <div class="card-body">
                                            <p class="text-info">被审计单位</p>
                                            {{ member.audit_company.audit_company }} {% if member.audit_company.audit_person  %} | {{ member.audit_company.audit_person }}{% endif %}
                                            <p class="text-info">记录内容</p>
                                            {{ member.schedule_content }}
                                            <p class="text-info">记录反馈</p>
                                            {{ member.schedule_feedback }}
                                            <p class="text-info">记录人</p>
                                            {% if member.username.first_name  %}{{ member.username.first_name }}{% else %}{{ title.project_exauditname }}{% endif %}
                                            <p class="text-info">记录开始时间</p>
                                            {{ member.start_time|date:"Y-m-d" }}
{#                                            {% if member.start_time  %}--星期{{ member.start_time.isoweekday }}{% endif %}#}
                                            <p class="text-info">记录结束时间</p>
                                            {{ member.end_time|date:"Y-m-d" }}
{#                                            {% if member.end_time  %}--星期{{ member.end_time.isoweekday }}{% endif %}#}
                                            {% if switch == 'open' and member_user.audit_role == 'lvl1' %}
                                            <p class="text-warning"><a href="{% url 'ex:schedule_detail' member.id %}" class="text-center">反馈</a></p>
                                            {% endif %}

                                        </div>
                                    </div>
                                </div>
                                {% endfor %}
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="card card-default">
                        <div class="card-header card-header-border-bottom">
                            <h2>项目记录</h2>
                        </div>
                        <div class="card-body">
                            <p class="mb-5" hidden> For accordion shadow add class <code> .accordion-shadow </code> to <code>
                                &lt;div id="accordion2" class="accordion"&gt; </code></p>
                            {% if switch == 'open' %}
                            <div id="accordion2" class="accordion accordion-shadow">
                                <div class="card">
                                    <div class="card-header" id="headingFour">
                                        <button class="btn btn-link" data-toggle="collapse" data-target="#collapseFour"
                                                aria-expanded="true" aria-controls="collapseFour">
                                            添加记录
                                        </button>
                                    </div>

                                    <div id="collapseFour" class="collapse show" aria-labelledby="headingFour"
                                         data-parent="#accordion2">

                                        <div class="card-body">
                                        <form>
												<div class="form-group">
													<label for="add_audit_company">被审计公司</label>
													<select class="form-control" id="add_audit_company" name="add_audit_company">

                                                        {% for company in audit_company %}
                                                            <option value="{{ company.id }}" >{{ company.audit_company }}  {% if company.audit_person %}|  {{ company.audit_person }}{% endif %}</option>
                                                        {% endfor %}
                                                        <option value="0"></option>
													</select>
												</div>
                                                <div class="form-group">
													<label for="exampleFormControlInput1">记录名称</label>
													<input type="text" class="form-control" id="add_schedule_title" name="add_schedule_title" placeholder="记录名称">
												</div>
                                            <div class="form-group">
													<label for="exampleFormControlTextarea1">记录内容</label>
													<textarea class="form-control" id="add_schedule_content" name="add_schedule_content" rows="5"></textarea>
												</div>
                                            <div hidden class="form-group">
													<label for="exampleFormControlTextarea1">记录反馈</label>
													<textarea class="form-control" id="add_schedule_feedback" name="add_schedule_feedback" rows="3"></textarea>
												</div>
                                                <div class="form-group">
													<label for="exampleFormControlInput1">记录开始时间</label>
													<input type="date" class="form-control" id="add_start_time" name="add_start_time" value="{{ this_date|date:"Y-m-d" }}">
												</div>
                                            <div class="form-group">
													<label for="exampleFormControlInput1">记录结束时间</label>
													<input type="date" class="form-control" id="add_end_time" name="add_end_time" value="{{ this_date|date:"Y-m-d" }}" >
												</div>
                                            <div class="form-footer pt-4 pt-5 mt-4 border-top">
													<button type="submit" class="btn btn-primary btn-default" id="schedule_submit">提交</button>
												</div>


                                            </form>
                                        </div>
                                    </div>

                                    </div>

                                </div>
                            {% endif %}
                             <div id="accordion2" class="accordion accordion-shadow">
                                <div class="card">
                                    <div class="card-header" id="headingFive">
                                        <button class="btn btn-link" data-toggle="collapse" data-target="#collapseFive"
                                                aria-expanded="true" aria-controls="collapseFive">
                                            项目过程附件
                                        </button>
                                    </div>
                                    <div id="collapseFive" class="collapse show" aria-labelledby="headingFive"
                                         data-parent="#accordion2">
                                        <div class="card-body">

                                      {% if switch == 'open' %}
                                                <button type="button"
                                                        class="mb-1 btn btn-pill btn-block  btn-outline-danger"
                                                        data-toggle="modal"
                                                        data-target="#exampleModalForm1">
                                                    上传记录附件
                                                </button>
                                        {% endif %}
                                        <div class="modal fade" id="exampleModalForm1" tabindex="-1" role="dialog"
                                         aria-labelledby="exampleModalFormTitle" aria-hidden="true">
                                        <div class="modal-dialog" role="document">
                                            <div class="modal-content">
                                                <div class="modal-header">
                                                    <h5 class="modal-title" id="exampleModalFormTitle">记录附件</h5>
                                                    <button type="button" class="close" data-dismiss="modal"
                                                            aria-label="Close">
                                                        <span aria-hidden="true">&times;</span>
                                                    </button>
                                                </div>
                                                <div class="modal-body">
                                                    {#                                                    <form id="jsAvatarForm" enctype="multipart/form-data"#}
                                                    {#                                                          method="post"#}
                                                    {#                                                          action="{% url 'users:user_changeimage' %}"#}
                                                    {#                                                          enctype="multipart/form-data">#}
                                                    {#                                                        {% csrf_token %}#}
                                                    <div class="form-group">
													<label for="add_audit_company">被审计公司</label>
													<select class="form-control" id="add_audit_company1" name="add_audit_company1">

                                                        {% for company in audit_company %}
                                                            <option value="{{ company.id }}" >{{ company.audit_company }} {% if company.audit_person %} |  {{ company.audit_person }} {% endif %}</option>
                                                        {% endfor %}
                                                        <option value="0"></option>
													</select>
												</div>
                                                    <input type="file"
                                                           id="schedule_file" name="schedule_file">
                                                    <input type="submit" class="mb-1 btn  disabled btn-primary"
                                                           id="schedule_file_submit" name="schedule_file_submit">
                                                    {#                                                    </form>#}
                                                </div>
                                                <div class="modal-footer">
                                                    <button type="button" class="btn btn-danger btn-pill"
                                                            data-dismiss="modal">关闭
                                                    </button>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
{#                                            {% endif %}#}
                                        {% for mem in member_name %}
                                        <p class="text-warning">{{ mem.username.first_name }}</p>
                                        <table class="table table-hover ">
                                            <thead>
                                            <tr>
                                                <th scope="col">序号</th>
                                                <th scope="col">文件名称</th>
                                                <th scope="col">被审计公司</th>
                                                <th scope="col"></th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            {% for sc_file in sc_file_list %}
                                                {% if sc_file.username.id == mem.username.id %}
                                                <tr class="schedule_file_list1">
                                                    <td scope="row">{{ forloop.counter }}</td>
                                                    <td><a href="
                                                            {{ MEDIA_URL }}{{ sc_file.schedule_file }}">{{ sc_file.schedule_file.name|slice:"23:" }}</a>
                                                    </td>
                                                    <td>{{ sc_file.audit_company.audit_company }} {% if sc_file.audit_company.audit_person %} |  {{ sc_file.audit_company.audit_person }}{% endif %}</td>
                                                    <td>
                                                        {% if sc_file.username.id == request.user.id and switch == 'open' %}
                                                        <button type="button"
                                                                class="mb-1 btn btn-pill btn-sm btn-outline-secondary schedule_file_del"
                                                                schedule_file_1="{{ sc_file.id }}">
                                                            删除
                                                        </button>
                                                            {% endif %}
                                                    </td>

                                                </tr>
                                                {% endif %}
                                            {% endfor %}
                                            </tbody>
                                        </table>
                                        {% endfor %}
                                        {% if title.project_exaudit == True %}
                                        <p class="text-warning">外审文件</p>
                                        <table class="table table-hover ">
                                            <thead>
                                            <tr>
                                                <th scope="col">序号</th>
                                                <th scope="col">文件名称</th>
                                                <th scope="col">被审计公司</th>
                                                <th scope="col"></th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            {% for sc_file in sc_file_list %}
                                                {% if not sc_file.username.id  %}
                                                <tr class="schedule_file_list1">
                                                    <td scope="row">{{ forloop.counter }}</td>
                                                    <td><a href="
                                                            {{ MEDIA_URL }}{{ sc_file.schedule_file }}">{{ sc_file.schedule_file.name|slice:"23:" }}</a>
                                                    </td>
                                                    <td>{{ sc_file.audit_company.audit_company }} {% if sc_file.audit_company.audit_person %} |  {{ sc_file.audit_company.audit_person }}{% endif %}</td>
                                                    <td>
                                                        {% if  switch == 'open' and member_user.audit_role == 'lvl1' %}
                                                        <button type="button"
                                                                class="mb-1 btn btn-pill btn-sm btn-outline-secondary schedule_file_del"
                                                                schedule_file_1="{{ sc_file.id }}">
                                                            删除
                                                        </button>
                                                            {% endif %}
                                                    </td>

                                                </tr>
                                                {% endif %}
                                            {% endfor %}
                                            </tbody>
                                        </table>
                                        {% endif %}
                                    </div>
                                        </div>
                                    </div>
                                </div>
                             </div>
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>




    </div>
{% endblock %}
{% block myjs %}
    <script>
    $(function () {
        $('#schedule_submit').click(function () {
                if (window.confirm('你确定提交吗？')) {
                    //alert("确定"); return true; }
                    {# 如果拿的是非表单类元素的值,用text(),如果是表单类元素用val() #}
                    var audit_company = $('#add_audit_company').val();
                    var schedule_title = $('#add_schedule_title').val();
                    var schedule_content = $('#add_schedule_content').val();
                    var schedule_feedback = $('#add_schedule_feedback').val();
                    var start_time = $('#add_start_time').val();
                    var end_time = $('#add_end_time').val();

                    $.ajax({
                        type: 'POST',
                        url: '{% url 'ex:add_schedule' %}',
                        {#mimeType: "multipart/form-data",#}
                        {#告诉jQuery不要去处理发送的数据, 发送对象。#}
                        {#processData : false,#}
                        {#告诉jQuery不要去设置Content-Type请求头#}
                        {#contentType : false,#}
                        {#async : false,#}
                        dataType: 'json',
                        data: {
                            "audit_company": audit_company,
                            "schedule_title": schedule_title,
                            "schedule_content": schedule_content,
                            "schedule_feedback": schedule_feedback,
                            "start_time": start_time,
                            "end_time": end_time,
                            "project_id": '{{ project_id }}',
                            "csrfmiddlewaretoken": '{{ csrf_token }}',
                        },
                        success: function (callback) {
                            if (callback.status == 'ok') {
                                {#console.log(data)#}
                                {#toastr.success(callback.msg);#}
                                {#alert(callback.msg);#}
                                {#window.location.href = '{% url 'plans:plans_list' %}';#}
                                window.location.reload()
                                {# 拿到点击对象的祖先节点 当中有类名是des的祖先节点#}
                                {#obj.parents('.module1_5').remove()#}
                                {#$('#notice_info_box').remove()#}
                                {#$('#notice_info_box').location.reload()#}
                            } else {
                                {#toastr.success(callback.msg);#}
                                alert(callback.msg);
                            }
                        }
                    });

                    {# 如果你不想让submit有提交的动作,那么就需要在事件函数的最后返回false,阻止提交动作的发生 #}
                    {#return false;#}
                } else {
                    {#//alert("取消"); return false; }#}
                    alert("取消")
                }

            })
        $('.schedule_del').click(function () {
                if (window.confirm('你确定删除吗？')) {
                    //alert("确定"); return true; }
                    {# 如果拿的是非表单类元素的值,用text(),如果是表单类元素用val() #}
                    var schedule_id = $(this).attr('schedule_id');
                    var obj = $(this);
                    $.ajax({
                        type: 'GET',
                        url: '{% url 'ex:schedule_del' %}',
                        dataType: 'json',
                        data: {
                            "schedule_id": schedule_id,
                            "project_id": '{{ project_id }}',
                        },
                        success: function (callback) {
                            if (callback.status == 'ok') {
                                toastr.success(callback.msg);
                                {#alert(callback.msg);#}
                                {#window.location.href = '{% url 'plans:plans_list' %}';#}
                                {#window.location.reload()#}
                                {# 拿到点击对象的祖先节点 当中有类名是des的祖先节点 #}
                                {#obj.parents('.module1_5').remove()#}
                                {#$('#notice_info_box').remove()#}
                                obj.parents('.schedule_list').remove()
                                {#obj.parents('.notice_del_body').reload()#}
                            } else {
                                {#toastr.success(callback.msg);#}

                                alert(callback.msg);
                            }
                        }
                    });

                    {# 如果你不想让submit有提交的动作,那么就需要在事件函数的最后返回false,阻止提交动作的发生 #}
                    {#return false;#}
                } else {
                    {#//alert("取消"); return false; }#}
                    alert("取消")
                }

            })
        $('#schedule_file_submit').click(function () {
                if (window.confirm('你确定新增吗？')) {
                    //alert("确定"); return true; }
                    {# 如果拿的是非表单类元素的值,用text(),如果是表单类元素用val() #}
                    var formdata = new FormData();
                    var schedule_file1 = $('#schedule_file')[0].files[0];
                    var audit_company1=$('#add_audit_company1').val();
                    {#let files = $('#notice_file1').filebox('files');#}
                    {#let fd = new FormData();#}
                    {#var notice_file1=document.getElementById('notice_file1').files[0]#}
                    formdata.append('schedule_file', schedule_file1);
                    formdata.append('audit_company', audit_company1);
                    formdata.append('project_id', '{{ project_id }}');
                    formdata.append('csrfmiddlewaretoken', '{{ csrf_token }}'),
                        $.ajax({
                            type: 'POST',
                            url: '{% url 'ex:schedule_file' %}',
                            {#dataType: 'json',#}
                            data: formdata,
                            {#cache: false,#}
                            {#    {#}
                            {#    "notice_file": notice_file,#}
                            {#    "notice_id": {{ notice_info.id }},#}
                            {#    "project_id":{{ project_id }},#}
                            {#    "csrfmiddlewaretoken": '{{ csrf_token }}',#}
                            {##}
                            {#,#}
                            {#不处理数据 enctype="multipart/form-data" #}
                            contentType: false,
                            {#不设置内容类型    #}
                            processData: false,
                            success: function (callback) {
                                if (callback.status == 'ok') {

                                    {#alert(callback.msg);#}
                                    {#window.location.href = '{% url 'plans:plans_list' %}';#}
                                    {#window.location.reload()#}
                                    {# 拿到点击对象的祖先节点 当中有类名是des的祖先节点 #}
                                    {#obj.parents('.module1_5').remove()#}
                                    {#$('#notice_info_box').remove(),#}
                                    window.location.reload();
                                    toastr.success(callback.msg);
                                } else {
                                    toastr.success(callback.msg);
                                    {#alert(callback.msg);#}
                                }
                            }
                        });

                    {# 如果你不想让submit有提交的动作,那么就需要在事件函数的最后返回false,阻止提交动作的发生 #}
                    {#return false;#}
                } else {
                    {#//alert("取消"); return false; }#}
                    alert("取消")
                }

            })
        $('.schedule_file_del').click(function () {
                if (window.confirm('你确定删除吗？')) {
                    //alert("确定"); return true; }
                    {# 如果拿的是非表单类元素的值,用text(),如果是表单类元素用val() #}
                    var schedule_file_id = $(this).attr('schedule_file_1');
                    var obj = $(this);
                    $.ajax({
                        type: 'GET',
                        url: '{% url 'ex:schedule_file_del' %}',
                        dataType: 'json',
                        data: {
                            "schedule_file_id": schedule_file_id,
                            "project_id": '{{ project_id }}',
                        },
                        success: function (callback) {
                            if (callback.status == 'ok') {
                                toastr.success(callback.msg);
                                {#alert(callback.msg);#}
                                {#window.location.href = '{% url 'plans:plans_list' %}';#}
                                {#window.location.reload()#}
                                {# 拿到点击对象的祖先节点 当中有类名是des的祖先节点 #}
                                {#obj.parents('.module1_5').remove()#}
                                {#$('#notice_info_box').remove()#}
                                obj.parents('.schedule_file_list1').remove()
                                {#obj.parents('.notice_del_body').reload()#}
                            } else {
                                {#toastr.success(callback.msg);#}

                                alert(callback.msg);
                            }
                        }
                    });

                    {# 如果你不想让submit有提交的动作,那么就需要在事件函数的最后返回false,阻止提交动作的发生 #}
                    {#return false;#}
                } else {
                    {#//alert("取消"); return false; }#}
                    alert("取消")
                }

            })
    })
    </script>
{% endblock %}